<!DOCTYPE HTML><html><head><meta charset="utf-8"><meta name="viewport" content="maximum-scale=1,minimum-scale=1,user-scalable=0,width=device-width,initial-scale=1"><meta name="format-detection" content="telephone=no,email=no,date=no,address=no"><link rel="stylesheet" href="../../../global/css/aui.css"><link rel="stylesheet" href="../../../global/css/my-css.css"><link rel="stylesheet" href="frm.css"></head><body><div class="bg-white m-t10 aui-hide" id="all-recommend"><div class="s-18 c-0 p-t20 p-b10 p-l10 p-r10" style="font-weight: bold">全部推荐</div><div class="p-b10 p-l10" id="find-friends"></div></div><div id="no-msg" class="aui-hide"><span class="aui-iconfont aui-icon-comment"></span></div><div id="goTop" class="aui-hide" tapmode onclick="goTop(this);"></div></body><script id="tpl-find-friends" type="text/x-dot-template">{{~it :v:i}}
    <div class="p-t10 flex between align-center" id="uid{{=v.uid}}">
        <div class="flex align-center" onclick="views.openUCenterWin({{=v.uid}}, &quot;{{=escapeStr(decodeEmoji(v.username))}}&quot;);">
            <div>
                <img src="{{=v.avatar}}" class="w-50 h-50 r100 img-d8" />
            </div>
            <div class="m-l10" onclick="views.openUCenterWin({{=v.uid}}, &quot;{{=escapeStr(decodeEmoji(v.username))}}&quot;);">
                <div>{{=decodeEmoji(v.username)}}</div>
                <!-- <div class="c-6 s-12 flex align-center">
                    {{? v.gender==2}}
                        <img class="w-8 h-10" src="../../../global/image/attention/male.png">
                    {{?? v.gender==1}}
                        <img class="w-8 h-10" src="../../../global/image/attention/female.png">
                    {{?}}
                    <span class="m-l3">{{=v.gender}}</span>
                    <span class="m-l5">{{=v.age}}岁</span>
                </div> -->
                <div class="s-11 c-9">{{=v.source}} </div>
            </div>
        </div>
        <div class="flex t-c">
            <div tapmode onclick="utils.focusPersonOption(this);" data-recommend_source="{{=v.source}}" data-attention-state="0" data-uid="{{=v.uid}}" data-from="find-friends">
                <button class="no-btn w-65 h-30 l-h25 bg-blue c-f t-c s-13 r4">关注</button>
            </div>
            <button class="no-btn w-30 h-30 l-h28 t-c" data-uid="{{=v.uid}}" tapmode onclick="closePerson(this);">
                <span class="aui-iconfont aui-icon-close c-6 s-11"></span>
            </button>
        </div>
    </div>
    {{~}}</script><script id="tpl-nowCity" type="text/x-dot-template">看看有谁在{{=it}}阅同城</script><script src="../../../config.js"></script><script src="../../../global/script/lib/api.js"></script><script src="../../../global/script/lib/doT.min.js"></script><script src="../../../global/script/libx/myRongIM.js"></script><script src="../../../global/script/mylib.js"></script><script src="../../../app.js"></script><script type="text/javascript">function toggleGoTop() {
        // 滚动时不处理，以免影响速度（可是，好像并没有什么用）
        if (!window.scrollTimer) {
            var go = $api.byId('goTop');
            var y = curY();
            if (y <= 10 && !$apix.isHide(go)) {
                $apix.addHide(go);
            } else if (y >= 200 && $apix.isHide(go)) {
                $apix.removeHide(go);
            }
        }
    }

    function goTop(el) {
        animToTop(function() {
            $apix.addHide(el);
        });

        sendEvent('go_top', {
            page: api.frameName,
            object: "button",
            obj_id: "button_go_top",
            resolution: api.screenWidth + '*' + api.screenHeight,
            operator: api.operator,
            nettype: api.connectionType
        });
    }
;

    apiready = function() {
        window.app.init4Frm(toggleGoTop);
        window.start = 1;
        window.nowCity = $api.getStorage('city');
        initFocus(window.start, cfg.lauders_one_load);
        addPageLoading();
        loadMore();
        bindRefreshFeed();
    };
    function initFocus(start,size,check){
        var uid = app.auth.getMyId();
        var data = {
            uid:parseInt(uid),
            dimension:[1,3,2,4],
            gid:parseInt(app.getGId()),
            page:start,
            limit:size,
        };

        gateway_rcmd_center('find_more_friends', data, {
            always: function() {
                rmPageLoading();
                rmFooterLoading();
                utils.setRefreshDone();
                rmFooterNoMore();
                $api.removeCls($api.byId('all-recommend'),'aui-hide');
                if(check){
                    $api.byId('find-friends').innerHTML = '';
                }
            },
            succ: function(json) {
                if(json.data.recommend_list <= 0){
                    window.start = -1;
                }
                var html = doT_Render('#tpl-find-friends', json.data.recommend_list);
                $api.append($api.byId('find-friends'), html);

            },
            fail: function(err, url) {
                utils.postErrWithTipsEx(err, url, data);
            }
        });
    }

    function fooPushLaud() {
        var html = doT_Render('#tpl-find-friends', mockLaudList);
        $api.append($api.byId('find-friends'), html)
        sofast(); // 优化 tapmode
    }

    function loadMore(){
        listenToScrollToBottom(function(ret, err) {
            if (window.start >= 0) {
                window.start++;
                addFooterLoading();
                initFocus(window.start,cfg.lauders_one_load);
            }
        });
    }
    function bindRefreshFeed() {
        utils.bindPullRefresh(function(onDone) {
            window.start = 1;
            initFocus(window.start, cfg.lauders_one_load, 1);
        });
    }

    // 叉掉某个推荐的人
    function closePerson(el) {
        if (!app.isLoggedIn()) {
            views.openAuthWin();
        }else{
            var uid = $api.attr(el,'data-uid');
            removeItem(uid);
            var data = {
                uid: parseInt(app.auth.getMyId()),
                recommender_id:parseInt(uid),
            };
            gateway_rcmd_center('right_reduction', data, {
                succ: function(json) {},
                fail: function(err, url) {
                    utils.postErrNoTipsEx(err, url, data);
                }
            });
        }
    }
    // 清空dom元素
    function removeItem(uid) {
        $api.remove($api.byId("uid" + uid));
    }</script></html>